import POJO.MoviePerformer;
import dao.MoviePerformerDAO;
import dao.MoviePerformerDAOImpl;

import java.sql.SQLException;
import java.util.List;

/**
 * @auther 尚智江
 * @Date 2022/5/5 20:35
 */
public class QueryByidTest {
    public static void main(String[] args)throws SQLException {
        MoviePerformerDAO moviePerformerDAO = new MoviePerformerDAOImpl();
              MoviePerformer moviePerformer = moviePerformerDAO.queryById(1);
              // 根据 id 查询电影信息
             System.out.println(moviePerformer.getMovieTitle() + " " +
                               moviePerformer.getName()+" "+moviePerformer.getId()+" "+moviePerformer.getRepresentive());

//        List<MoviePerformer> list = moviePerformerDAO.queryByName("刘嘉玲");
//        for (MoviePerformer performer : list) {
//            System.out.println(performer.getId()+" "+performer.getMovieTitle() + " " +
//                    performer.getName() + " " + performer.getRepresentive());
//        }
//        System.out.println(moviePerformerDAO.queryByName("刘嘉玲"));
    }
}
